
<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
*/
$res= $pages->getPageResources();
$pageRes = $pages->getpResource();
$pageResourceCount  = count($res);
$imagediv="";
    $audiodiv="";
    $videodiv="";
    $docdiv="";
    $othersdiv="";
if($pageResourceCount>0) {
    
    for($i=0;$i<$pageResourceCount;$i++) {
        switch($res[$i]->category) {
            case $pageRes->IMAGES: {
                    $imagediv.="
					<li>
						<a href='".$HOME_URL."resources/".$res[$i]->resourceurl."' title='".$res[$i]->resoucedesc."'>
							".$res[$i]->resoucedesc."<img src='".$HOME_URL."resources/image.php?im=".$res[$i]->resourceurl."&s=250'  title='".$res[$i]->resoucedesc."'  alt='".$res[$i]->resoucedesc."' />
							<div class='smalltxt'>".$res[$i]->resoucedesc."</div>
						</a>
				    </li>";
                    break;
                }
            case $pageRes->AUDIO: {
                    $audiodiv.="
					<embed loop='false' class='playaudio' type='audio/mpeg' autostart='false'
                             src='".$HOME_URL."resources/".$res[$i]->resourceurl."' title='".$res[$i]->resoucedesc."' />
                      <a href='".$HOME_URL."resources/download.php?file=".$res[$i]->resourceurl."' class='download'>Download</a>";
                    break;
                }
            case $pageRes->DOC: {
                    $docdiv.=" <a href='".$HOME_URL."resources/".$res[$i]->resourceurl."' class='download'>".$res[$i]->resoucedesc."
                             View Document</a>";
                    break;
                }
            case $pageRes->OTHERS: {
                    $othersdiv.=$res[$i]->resoucedesc."
                              <a href='".$HOME_URL."resources/download.php?file=".$res[$i]->resourceurl."' class='download'>Download</a>";
                    break;
                }
            case $pageRes->VIDEO: {
			$VIDEO_FILE = $HOME_URL."resources/".$res[$i]->resourceurl;
                    $videodiv.=$res[$i]->resoucedesc."
                              <a href='".$HOME_URL."resources/download.php?file=".$res[$i]->resourceurl."' class='download'>Download</a>";		
                    break;
                }
        }
        //echo "<a href='?page=".$res[$i]->resourceid."' >$i".$res[$i]->resourceurl."</a><br />";

    }
}

if($pages->listType==4)//Gallery
{
    include 'component/gallery/default.php';

}else {
if($pageRes->videoNum>0)
    {
	?>
	
	<?php }
    if($pageRes->imagesNum>0 ||  $pageRes->audioNum>0 || $pageRes->docNum>0 || $pageRes->videoNum>0 || $pageRes->othersNum>0 ) {
        echo "<div id='page_resources'>";

        if($pageRes->imagesNum>0) {
            $next="";
			if($pageRes->imagesNum>1)
			{$next="<div class=\"buttons\">
						<a href=\"#\" title=\"Previous\" id=\"prev\">Previous</a>
						<a href=\"#\" title=\"next\" id=\"next\">Next</a>
					</div>";}
            echo "<div class='image_list'><div class='slider'><ul>".$imagediv."</ul></div>$next</div>";
        }
        if($pageRes->audioNum>0) {
            echo "<div class='audio_list'>".$audiodiv."</div>";
        }
        if($pageRes->docNum>0) {
            echo "<div class='doc_list'>".$docdiv."</div>";
        }
        if($pageRes->videoNum>0) {
            echo "<div class='video_list'>".include("component/flvplayer/flowplayer/setup.php");
			  echo $videodiv."</div>";
        }
        if($pageRes->othersNum>0) {
            echo "<div class='other_list'>".$othersdiv."</div>";
        }
        echo "</div>";
    }
}
?>

